package org.col.dspace.tagger.model;

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.dspace.content.Bitstream;

public class TagGeneratorText extends AbstractTagGenerator{

	public TagGeneratorText(Bitstream bstream) {
		super(bstream);
	}

	@Override
	protected String retrieveText(InputStream istream) throws IOException {
		StringBuffer strBuf = new StringBuffer();
		BufferedReader reader = new BufferedReader(new InputStreamReader(
				istream));

		try {

			String str;
			while ((str = reader.readLine()) != null)
				strBuf.append(str);
		} catch (IOException e) {

			throw e;
		} finally {
			reader.close();
		}
		return strBuf.toString();

	}
	
	

}
